//
//  CarModel.m
//  UI19 - Car(汽车之家)
//
//  Created by 韩旭 on 16/8/9.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "CarModel.h"

@implementation CarModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        self.ID = (NSInteger)value;
    }
}
- (instancetype)initWithDic:(NSDictionary *)dic {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
+ (instancetype)carModelWithDic:(NSDictionary *)dic {
    return [[CarModel alloc] initWithDic:dic];
}
+ (NSArray *)carModelWithArray:(NSArray *)array {
    NSMutableArray *arrList = [NSMutableArray array];
    for (NSDictionary *dic in array) {
        [arrList addObject:[CarModel carModelWithDic:dic]];
    }
    return arrList;
}
@end
